package vmcs.store;

import java.util.Observable;

// Copyright 1997 ISS.
// The contents contained in this document may not be reproduced in any
// form or by any means, without the written permission of ISS, other
// than for the purpose for which it has been supplied.
//
// Author: Olivo Miotto
//

public class StoreItem extends Observable{

    private StoreObject	content;
    private int		quantity;

    public StoreItem (StoreObject content, int quantity) {
        this.content = content;
        this.quantity = quantity;
    }

    public StoreObject getContent () {
        return content;
    }

    public void setContent(StoreObject ct){
      content = ct;
    }

    public void setQuantity (int quantity) {
        this.quantity = quantity;
        this.setChanged();
        notifyObservers(this);
    }

    public int getQuantity () {
        return quantity;
    }


    public void store () {
        quantity++;
        this.setChanged();
        notifyObservers(this);
    }

    public void decrement () {
        quantity--;
        this.setChanged();
        notifyObservers(this);
    }
}

